<template>
	<div>
		<div class="box">
			<div class="title">
				<span class="tag"></span>
				租金调整-加装
			</div>
			<ATable
				v-model="formData.arr"
				:config="tableColumns"
				:state="state"></ATable>
			<el-button
				v-if="state !== 'disabled' && state !== 'readonly'"
				class="btn"
				plain
				type="primary"
				size="default"
				icon="el-icon-plus">
				增加其他装饰项
			</el-button>
		</div>
	</div>
</template>

<script>
	import ATable from '@/components/A/A-form/table/index.vue';
	export default {
		name: '',
		components: { ATable },
		props: {
			value: {
				type: Object,
				default: () => {
					return {};
				},
			},
			state: {
				required: false,
			},
		},
		data() {
			return {};
		},
		computed: {
			formData: {
				get() {
					return this.useVModel.call(this);
				},
				set(val) {
					this.$emit('input', val);
				},
			},
			tableColumns() {
				return [
					{
						label: '选择',
						type: ({ row }) => {
							return 'checkbox';
						},
						show: this.state !== 'readonly',
						prop: 'a',
						prototype: {
							trueLabel: 1,
							falseLabel: 0,
						},
					},
					{
						label: '装饰项',
						prop: 'a',
						type: ({ row }) => {
							return 'select';
						},
						dict: {
							list: [],
						},
					},
					{
						label: '数量',
						prop: 'a',
						type: 'input_number',
					},
					{
						label: '装饰单项费',
						prop: 'a',
						type: 'price',
					},
					{
						label: '说明',
						prop: 'a',
						type: 'textarea',
						prototype: {
							minRows: 1,
							maxRows: 1,
						},
					},
				];
			},
		},
		created() {},
		mounted() {},
		methods: {},
	};
</script>

<style lang="scss" scoped>
	.box {
		border-radius: 8px;
		background-color: #fff;
		.title {
			font-size: 14px;
			font-family: PingFangSC, PingFang SC;
			font-weight: 500;
			color: #333333;
			line-height: 22px;
			padding-top: 15px;
			padding-bottom: 15px;
			// border-bottom: 1px solid #e9e9e9;
			display: flex;
			align-items: center;
			.tag {
				width: 8px;
				height: 8px;
				background-color: #1890ff;
				border-radius: 100%;
				margin-right: 10px;
			}
			.price {
				font-size: 14px;
				font-family: PingFangSC, PingFang SC;
				font-weight: 400;
				color: #1890ff;
				line-height: 20px;
				margin-left: 20px;
			}
		}
	}
	.btn {
		margin-top: 15px;
		width: 100%;
	}
</style>
